package pl.matt.media.manager;


import java.io.File;
import java.io.IOException;

import pl.matt.media.model.ImageType;
import pl.matt.model.Rectangle;

/**
 * @author mateusz
 *
 */
public interface ImageManager {

	/**
	 * @param sourceImagePath
	 * @param destinationImagePath
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 * @param imageType
	 * @return
	 * @throws IOException
	 */
	public boolean cropImage(String sourceImagePath, String destinationImagePath, int x, int y, int width,
			int height, ImageType imageType) throws IOException;

	/**
	 * @param sourceImagePath
	 * @param destinationImagePath
	 * @param region
	 * @param imageType
	 * @return
	 * @throws IOException
	 */
	public boolean cropImage(String sourceImagePath, String destinationImagePath, Rectangle rectangle, ImageType imageType) throws IOException;	
	
	/**
	 * @param sourceImagePath
	 * @param destinationImagePath
	 * @param imageType
	 * @return
	 * @throws IOException
	 */
	public boolean convertToGrayScale(String sourceImagePath, String destinationImagePath, ImageType imageType) throws IOException;
	
	/**
	 * @param sourceImagePath
	 * @param destinationImagePath1
	 * @param destinationImagePath2
	 * @param horizontal
	 * @param imageType
	 * @throws IOException
	 */
	void divideImage(String sourceImagePath, String destinationImagePath1, String destinationImagePath2,
			boolean horizontal, ImageType imageType) throws IOException;

	/**
	 * @param sourceImagePath
	 * @param destinationImagePath
	 * @param xPercentage
	 * @param yPercentage
	 * @param widthPercentage
	 * @param heightPercentage
	 * @param imageType
	 * @return
	 * @throws IOException
	 */
	boolean cropImageWithPercentageDimensions(String sourceImagePath, String destinationImagePath, int xPercentage,
			int yPercentage, int widthPercentage, int heightPercentage, ImageType imageType) throws IOException;

	/**
	 * @param imageFile
	 * @return
	 * @throws IOException
	 */
	Rectangle getImageRectangle(File imageFile) throws IOException;
}
